#!/bin/bash
set -x
Server_IP=127.0.0.1
NODE_ID=$1
./tc &

# 清理进程
killall iperf3
sleep 3
# 启动server
index=0
while [ ${index} -lt 8 ]
do
	numactl -N ${NODE_ID} -m ${NODE_ID} iperf3 -s -B ${Server_IP} -p 100${index}  &
	let index=${index}+1
done
# 等待server启动
sleep 3
counter=0
while [ 1 -eq 1 ]
do
        echo "fio $(date) counter=${counter}"
	let index=0
 	while [ ${index} -lt 7 ]
	do
		numactl -N ${NODE_ID} -m ${NODE_ID} iperf3 -c ${Server_IP} -p 100${index} &
		let index=${index}+1
	done
	numactl -N ${NODE_ID} -m ${NODE_ID} iperf3 -c ${Server_IP} -p 100${index} 
        let counter=${counter}+1
done
